<template>
  <el-dialog
    title="详情"
    :close-on-click-modal="false"
    append-to-body
    :visible.sync="visible"
    class="jsbos-dialog jsbos-dialog_center"
    lock-scroll
    width="600px"
  >
    <transition name="el-zoom-in-center">
      <el-row :gutter="15" class="">
        <el-form
          ref="elForm"
          :model="dataForm"
          size="small"
          label-width="100px"
          label-position="right"
          style="height: 500px"
        >
          <template v-if="!loading">
            <el-descriptions
              class="margin-top"
              title=""
              :column="1"
              size="mini"
              style="margin-left: 50px; margin-top: 15px; margin-right: 50px"
              border
            >
              <el-descriptions-item
                label="短链接:"
                :labelStyle="unionLabelStyle"
                :contentStyle="unionContentStyle"
                >{{ dataForm.exposeLink }}</el-descriptions-item
              >
              <el-descriptions-item
                label="共享类型："
                :labelStyle="unionLabelStyle"
                :contentStyle="unionContentStyle"
                >{{
                  dataForm.shareType == "1" ? "内部" : "对外"
                }}</el-descriptions-item
              >
              <el-descriptions-item
                label="共享人员："
                :labelStyle="unionLabelStyle"
                :contentStyle="unionContentStyle"
                v-if="dataForm.shareType == '1'"
                >{{ dataForm.shareUserName }}</el-descriptions-item
              >
              <el-descriptions-item
                label="认证方式:"
                :labelStyle="unionLabelStyle"
                :contentStyle="unionContentStyle"
                v-if="dataForm.shareType == '2'"
                >{{ dataForm.password }}</el-descriptions-item
              >
              <el-descriptions-item
                label="截止时间:"
                :labelStyle="unionLabelStyle"
                :contentStyle="unionContentStyle"
                >{{
                  jsbos.dateFormat(Number(dataForm.endTime))
                }}</el-descriptions-item
              >
              <el-descriptions-item
                label="创建时间:"
                :labelStyle="unionLabelStyle"
                :contentStyle="unionContentStyle"
                >{{
                  jsbos.dateFormat(Number(dataForm.creatorTime))
                }}</el-descriptions-item
              >

              <el-descriptions-item
                label="创建用户:"
                :labelStyle="unionLabelStyle"
                :contentStyle="unionContentStyle"
                >{{ dataForm.creatorUserName }}</el-descriptions-item
              >
            </el-descriptions>
          </template>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
      </span>
    </transition>
  </el-dialog>
</template>
<script>
import {
  ShareCreate,
  ShareUserList,
  Download,
  getShareEntityById,
  shareUpdate,
} from "@/api/extend/document";
import request from "@/utils/request";
import jsbos from "@/utils/jsbos";
export default {
  components: {},
  props: [],
  data() {
    return {
      unionLabelStyle: {
        width: "2px",
        "text-align": "center",
        "font-size": "14px",
        "padding-right": "5px",
      },
      unionContentStyle: {
        width: "100px",
        "text-align": "left",
        "font-size": "12px",
        "padding-left": "10px",
      },
      visible: false,
      loading: false,
      printId: "",
      dataForm: {
        id: "",
        type: "",
        creatorUserId: "",
        creatorTime: "",
      },
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    dataInfo(dataAll) {
      let _dataAll = dataAll;
      _dataAll.files = _dataAll.files ? JSON.parse(_dataAll.files) : [];
      this.dataForm = _dataAll;
    },

    init(id) {
      this.visible = true;
      getShareEntityById(id).then((res) => {
        let data = res.data;
        data.password = data.password == "1" ? "无" : data.password;

        this.dataForm = data;
      });
    },
  },
};
</script>
